<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    [v-cloak] {
      display: none;
    }
  </style>
</head>
<body>
<!--<div id="app" v-cloak>-->
<!--  <h1 v-if="score>=90">优秀</h1>-->
<!--  <h1 v-else-if="score>=80">良好</h1>-->
<!--  <h1 v-else-if="score>=70">及格</h1>-->
<!--  <h1 v-else>不及格</h1>-->
<!--</div>-->
<div id="app" v-cloak>
  <h1>{{result}}</h1>
</div>

<script src="../js/vue.js"></script>
<script>
  //let(变量)和const(常量)
  const app = new Vue({
    el: '#app',
    data: {
      message: '中国牛蛙！',
      score: 99
    },
    computed: {
      result() {
        let level;
        if (this.score >= 90) {
          level = '优秀';
        } else if (this.score >= 80) {
          level = '良好';
        } else if (this.score >= 70) {
          level = '及格';
        } else {
          level = '不及格'
        }
        return level;
      }
    }
  })
</script>
</body>
</html>